package com.wjj.sixinone.controller.admin;


import com.wjj.sixinone.common.enums.ApiTypeConst;
import com.wjj.sixinone.common.pojo.entity.Bed;
import com.wjj.sixinone.common.pojo.vo.BedVO;
import com.wjj.sixinone.common.pojo.vo.RoomForm;
import com.wjj.sixinone.common.pojo.vo.RoomVO;
import com.wjj.sixinone.common.util.Result;
import com.wjj.sixinone.service.RoomService;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import org.springframework.stereotype.Controller;

import java.util.Map;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 小王不秃头
 * @since 2024-07-22
 */
@RestController
@RequestMapping(ApiTypeConst.API_ADMIN+"/room")
public class RoomController {
    @Autowired
    private RoomService roomService;
    @GetMapping("/selectRoomByLimit")
    public Result selectRoomByLimit(RoomVO roomVO)
    {
        return roomService.selectRoomByLimit(roomVO);
    }
    @PostMapping("/updateById")

    public Result updateById(@RequestBody RoomForm roomForm)
    {
        return roomService.updateRoomById(roomForm);
    }
    @PostMapping("/addRoom")
    public Result addRoom(@RequestBody RoomForm roomForm)
    {
        return roomService.addRoom(roomForm);
    }
    @GetMapping("/uploadExcel")
    public void uploadExcel(HttpServletResponse httpServletResponse)
    {
        roomService.uploadExcel(httpServletResponse);
    }
    @PostMapping("/deleteById")
    public Result deleteById(@RequestBody Map<String,String> map)

    {
        return roomService.deleteRoomById(map);
    }






}

